﻿using System;
using Dora.Tools.Enums.AdminUser;
using Dora.Tools.Enums.SysLog;
using Surging.Core.CPlatform.EventBus.Events;

namespace Dora.Tools.Events.LogsEvents
{
    public class SysLogEvent : IntegrationEvent
    {
        /// <summary>
        /// 日志类型
        /// </summary>
        public LogType LogType { get; set; }

        /// <summary>
        /// 消息体
        /// </summary>
        public string Body { get; set; }
    }

    /// <summary>
    /// 操作日志Body
    /// </summary>
    public class OperationLogBody
    {
        /// <summary>
        /// 系统Key
        /// </summary>
        public string SystemKey { get; set; }

        /// <summary>
        /// 操作类型
        /// </summary>
        public short OpType { get; set; }

        /// <summary>
        /// 参数值
        /// </summary>
        public string ParamValue { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OpTime { get; set; }

        /// <summary>
        /// 操作人Id
        /// </summary>
        public Guid? OpUserId { get; set; }

        /// <summary>
        /// 操作人
        /// </summary>
        public string OpUserName { get; set; }


    }

    /// <summary>
    /// 产品操作日志Body
    /// </summary>
    public class ProductOperationLogBody
    {
        /// <summary>
        /// 功能名称;枚举：产品基本信息、产品特色、费用包含等
        /// </summary>
        public string Modulekey { get; set; }

        /// <summary>
        /// 接口名称
        /// </summary>
        public string MethodName { get; set; }

        /// <summary>
        /// 日志在后端记录点;HOST、SERVER
        /// </summary>
        public string ServiceType { get; set; }

        /// <summary>
        /// 系统名称;枚举：web-srm、web-tas
        /// </summary>
        public string SystemKey { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 请求参数josn
        /// </summary>
        public string RequestParam { get; set; }

        /// <summary>
        /// 操作人Id
        /// </summary>
        public Guid? OpUserId { get; set; }
        /// <summary>
        /// 操作人姓名
        /// </summary>
        public string OpUserName { get; set; }
        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OpTime { get; set; }
    }

    /// <summary>
    /// 产品错误日志Body
    /// </summary>
    public class ProductErrorLogBody
    {
        /// <summary>
        /// 功能名称;枚举：产品基本信息、产品特色、费用包含等
        /// </summary>
        public string Modulekey { get; set; }

        /// <summary>
        /// 接口名称
        /// </summary>
        public string MethodName { get; set; }

        /// <summary>
        /// 日志在后端记录点;HOST、SERVER
        /// </summary>
        public string ServiceType { get; set; }

        /// <summary>
        /// 系统名称;枚举：web-srm、web-tas
        /// </summary>
        public string SystemKey { get; set; }

        /// <summary>
        /// 请求参数josn
        /// </summary>
        public string RequestParam { get; set; }

        /// <summary>
        /// 错误堆栈信息;记录异常堆栈信息
        /// </summary>
        public string ErrorStackTrace { get; set; }

        /// <summary>
        /// 操作人Id
        /// </summary>
        public Guid? OpUserId { get; set; }

        /// <summary>
        /// 操作人姓名
        /// </summary>
        public string OpUserName { get; set; }

        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime OpTime { get; set; }
    }


    public class LoginLogBody
    {
        /// <summary>
        /// 系统名称;枚举：web-srm、web-tas
        /// </summary>
        public string SystemKey { get; set; }
        /// <summary>
        /// 机构Id
        /// </summary>
        public int OrgId { get; set; }
        /// <summary>
        /// 用户主键
        /// </summary>
        public Guid UserId { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }
        /// <summary>
        /// 登录方式;0用户名密码登录
        /// </summary>
        public short LoginType { get; set; }
        /// <summary>
        /// IP
        /// </summary>
        public string IP { get; set; }
    }

    //public class UserLogEvent : IntegrationEvent
    //{
    //    /// <summary>
    //    /// 日志类型
    //    /// </summary>
    //    public LogType LogType { get; set; }

    //    /// <summary>
    //    /// 消息体
    //    /// </summary>
    //    public string Body { get; set; }

    //    public UserLogBaseInfo LogInfo { get; set; }
    //}


    //public abstract class UserLogBaseInfo
    //{
    //    public Guid id { get; set; }

    //    public DateTime CreatedTime { get; set; }
    //}

    //public class OrderLogInfo : UserLogBaseInfo
    //{
    //    public string OrderNO { get; set; }
    //}
}
